</head>
<body>
<div class="f-sep10"></div>
<div class="f-sep10"></div>
<div class="m-hd m-tabs">
  <h2 class="u-tt">{$action_name}多图广告</h2>
  <ul id="tabs">
    <li> <a class="z-crt" href="#tab1"><span class="icon">&#xf05a;</span> 基本信息</a></li>
	<li><a href="{$url(admin_list/index)}"><span class="icon">&#xf101;</span> 广告位列表</a></li>
  </ul>
</div>
<div class="f-sep10"></div>
<div class="m-form">
  <form action="<?php echo url('admin_list/'.$action.'_save'); ?>" method="post" id="form">
    <fieldset>
      <div class="formitm">
        <label class="lab" >广告名称：</label>
        <div class="ipt">
          <input name="title" type="text" class="u-ipt" id="title" value="{$info.title}" datatype="*1-20" errormsg="表单名称至少1~20个字符！" />
          <span class="Validform_checktip">该广告位的描述</span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >广告标识：</label>
        <div class="ipt">
          <input name="sign" type="text" class="u-ipt" id="sign" value="{$info.sign}" datatype="/^\w+$/" errormsg="广告标识只能为英文和下划线！" />
          <span class="Validform_checktip">广告位调用标识</span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >广告开始时间：</label>
        <div class="ipt">
<input name="start_time" type="text" class="u-ipt" id="start_time" value="<?php if(!empty($info['start_time'])){ echo date($info['start_time'],'Y-m-d H:i:s'); } ?>" ><span id="start_time_button" class="u-ico f-csp"><span class="icon">&#xf017;</span> 选择</span>
          <span class="Validform_checktip">留空开始时间不限</span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >广告结束时间：</label>
        <div class="ipt">
<input name="stop_time" type="text" class="u-ipt" id="stop_time" value="<?php if(!empty($info['stop_time'])){ echo date($info['stop_time'],'Y-m-d H:i:s'); } ?>" ><span id="stop_time_button" class="u-ico f-csp"><span class="icon">&#xf017;</span> 选择</span>
          <span class="Validform_checktip">留空到期时间不限</span> </div>
      </div>
      <div class="formitm">
        <label class="lab" >上传图片：</label>
      <div class="ipt">
		<button class="u-btn u-btn-c4" id="upload" type="button">上传</button>
        <span class="Validform_checktip">单个图片2M内</span>
      </div>
      <div id="images">
      <!--foreach:{$info['images_list'] $vo}-->
      	<div class="formitm">
			<label class="lab">图片地址：</label>
			<div class="ipt">
			  <input name="image[]" type="text" class="u-ipt u-ipt-1" id="sign" value="{$vo.image}" />&nbsp;&nbsp;
			  <a href="javascript:;"  target="_blank" onClick="window.open($(this).prev().val());">预览</a>
			  链接：<input name="url[]" type="text" class="u-ipt u-ipt-2" id="sign" value="{$vo.url}" />&nbsp;&nbsp;
			  说明：<input name="txt[]" type="text" class="u-ipt u-ipt-2" id="sign" value="{$vo.txt}" />&nbsp;&nbsp;
			  顺序：<input name="order[]" type="text" class="u-ipt u-ipt-2" id="sign" value="{$vo.order}" />
			  <a href="javascript:;" onClick="$(this).parent().parent().remove()">删除</a>
		</div></div>
      
      <!--{/foreach}-->
      </div>
            
      <div class="formitm formitm-1">
        <button class="u-btn" id="submit" type="submit">保存修改</button>
        <button class="u-btn u-btn-c4" id="reset" type="button">重置</button>
        <span id="tip" class="load"></span> </div>
    </fieldset>
    <input name="file_id" id="file_id" type="hidden" value="{$file_id}" />
    <input name="id" type="hidden" value="{$info.id}" />
    <input name="type" type="hidden" value="{$type}" />
  </form>
 </div>
</body>

<script>
Do.ready('base','form','calendar',"dialog", function() {
	$('#upload').click(function(){
		urldialog({
			title:'图片上传',
			url:"{$url(admin_list/images_upload)}",
			width:615,
			height:410
        });
	});
	//时间选择
	$('#start_time_button').calendar({ id:'#start_time',format:'yyyy-MM-dd HH:mm:ss'});
	$('#stop_time_button').calendar({ id:'#stop_time',format:'yyyy-MM-dd HH:mm:ss'});
	saveform('{$url(admin_list/index)}');
	
});
</script>